package com.corpcredit.webapp.action;

import java.io.Serializable;
import java.util.Set;

import com.corpcredit.model.Fzjgxx;
import com.corpcredit.model.Gjfxx;
import com.corpcredit.model.Jbqk;
import com.corpcredit.service.GenericManager;
import com.corpcredit.service.LookupManager;

public class JbqkAllForm extends BasePage implements Serializable {
    private Gjfxx gjfxx = new Gjfxx();
    private Long id;
    private GenericManager<Jbqk, Long> jbqkManager;
    private LookupManager lookupManager;
    private Jbqk jbqkCopy=null;
    private boolean hasGotJbqk=false;
    
    public Long getId()
    {
    	return this.id;
    }
    public void setLookupManager(LookupManager lookupManager) {
        this.lookupManager = lookupManager;
    }
    
    public void setJbqkManager(GenericManager<Jbqk, Long> jbqkManager) {
        this.jbqkManager = jbqkManager;
    }

    public Jbqk getJbqk() {
    	//return super.getJbqk();
    	 if(hasGotJbqk)
    	 {
    		 return jbqkCopy;
    	 }else
    	 { 
    		 log.debug( "###########################jbqk: " +  super.getJbqk().getId());
    		 hasGotJbqk=true;
    		 jbqkCopy=jbqkManager.get(super.getJbqk().getId() );
    		 return jbqkCopy;
    	 }
    }
    
    public Gjfxx getGjfxx() {
        Jbqk jbqk = getJbqk();
        log.debug( "================jbqkid: " +  jbqk.getId());
        if (jbqk != null && jbqk.getId() != null) {
            gjfxx = (Gjfxx) lookupManager.findByJbqkID(Gjfxx.class, jbqk.getId());
            log.debug( "================gjfxxid: " +  gjfxx.getId());
        }
        if(gjfxx == null)
        {
            gjfxx = new Gjfxx();
        }
        return gjfxx;
    }

    public void setId(Long id) {
        this.id = id;
    }
} 
